<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>瓦片地图下载器</title>
    <link rel="stylesheet" type="text/css" href="lib/leaflet/leaflet.css">
    <link rel="stylesheet" type="text/css" href="css/index.css">
    <link rel="stylesheet" type="text/css" href="lib/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="lib/jRange/jquery.range.css">

</head>
<body>
<div id="map"></div>
<script>
    const $ = require('jquery');
    const jQuery = $;
    //创建 client
    const {remote} = require('electron');
    const {Menu, MenuItem} = remote;
    const ipcRenderer = require('electron').ipcRenderer;
    //调试模式使用
    // if (require('electron-connect')) {
    //     require('electron-connect').client.create();
    // }
    let totalNumber=0;//总瓦片数量
    let totalNumber_=0;//总瓦片数量
</script>
<script src="lib/jquery.easyui.min.js"></script>
<script src="widget/progress.js"></script>
<script src="widget/levelSelector.js"></script>
<script src="lib/jRange/jquery.range-min.js"></script>
<script src="lib/leaflet/leaflet.js"></script>
<script src="js/listener.js"></script>
<script src="js/map.js"></script>
<script src="js/common.js"></script>
<script src="js/ui.js"></script>
<script src="js/squareSelection.js"></script>

<script>

    //右键餐单
    const menu = new Menu();
    menu.append(new MenuItem({
        label: '清除范围',
        click: function () {
            setDownBtnState(false);
            removeLayer("selection");
        }
    }));
    menu.append(new MenuItem({type: 'separator'}));//分割线
    menu.append(new MenuItem({
        id: "down", label: '下载', enabled: false, click: function () {
            openLevelSelector();
            $("button.positive").click(function () {
                downTiles();
            })
        }
    }));//选中
    menu.append(new MenuItem({
        id: "ani", label: '动画', click: function () {
            hideProgress();
        }
    }));//选中
    window.addEventListener('contextmenu', (e) => {
        e.preventDefault();
        menu.popup({window: remote.getCurrentWindow()})
    }, false);


</script>
</body>
</html>